/* styles.css */

.company-node::after {
    content: '';
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 2px;
    background-color: var(--primary-color);
}

.company-node:last-child::after {
    display: none;
}
:root {
    --primary-color: #5b8cba;
    --secondary-color: #a7c4bc;
    --accent-color: #e74c3c;
    --background-color: #f8f9fa;
    --text-color: #333;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --highlight-color: #fff8c5;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    margin: 0;
    padding: 20px 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-title {
    text-align: center;
    color: var(--primary-color);
    margin: 30px 0;
    font-weight: 600;
    font-size: 2.2rem;
    width: 100%;
}

.supply-chain-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px var(--shadow-color);
    padding: 20px;
    min-height: 600px;
    width: 98%;
    margin: 0 auto;
}

.supply-chain-horizontal {
    flex: 1;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    overflow: auto;
    position: relative;
    padding: 0 20px;
    flex-wrap: wrap;
    gap: 20px;
}

.details-panel {
    flex: 1;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 8px var(--shadow-color);
    padding: 15px;
    display: flex;
    flex-direction: column;
    min-width: 450px;
}

.details-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.header-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 20px;
}

.export-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.export-btn {
    padding: 8px 16px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.export-btn:hover {
    background-color: #4a7ba8;
}

.details-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
}

.details-content {
    flex-grow: 1;
    overflow-y: auto;
}

.tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    padding: 8px 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    font-size: 14px;
}

.tab-btn:hover {
    opacity: 1;
}

.tab-btn.active {
    opacity: 1;
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
    height: calc(100% - 50px);
    overflow-y: auto;
}

.tab-content.active {
    display: block;
}

.company-node {
    padding: 12px 15px;
    margin: 0 8px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 4px var(--shadow-color);
    cursor: pointer;
    transition: all 0.2s;
    border-top: 4px solid var(--primary-color);
    position: relative;
    min-width: 200px;
    text-align: center;
}

.company-node:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--shadow-color);
}

.company-node.core {
    border-left-color: var(--accent-color);
    background-color: rgba(231, 76, 60, 0.05);
}

.company-node.level-1 {
    border-left-color: #3498db;
}

.company-node.level-2 {
    border-left-color: #2ecc71;
}

.company-node.level-3 {
    border-left-color: #f1c40f;
}

.company-node.level-4 {
    border-left-color: #e67e22;
}

.company-node.level-5 {
    border-left-color: #1abc9c;
}

.company-node.level-6 {
    border-left-color: #9b59b6;
}

.company-node.level-7 {
    border-left-color: #34495e;
}

.company-node.level-8 {
    border-left-color: #e74c3c;
}

.company-node.level-9 {
    border-left-color: #27ae60;
}

.company-node.level-10 {
    border-left-color: #f39c12;
}

.company-node.level-11 {
    border-left-color: #16a085;
}

.company-name {
    font-weight: 600;
    margin-bottom: 5px;
}

.company-level {
    font-size: 12px;
    color: #666;
}

.goods-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 14px;
}

.goods-table th, .goods-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    word-break: break-word;
    max-width: 150px;
}

.goods-table td.highlight {
    background-color: var(--highlight-color);
    font-weight: 500;
}

.goods-table th {
    background-color: rgba(91, 140, 186, 0.1);
    color: var(--primary-color);
}

.goods-table tr:hover {
    background-color: rgba(91, 140, 186, 0.05);
}

.relationship {
    margin: 15px 0;
    padding: 10px;
    background-color: rgba(167, 196, 188, 0.1);
    border-radius: 6px;
}

.relationship-title {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
}

.no-data {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}